
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>机器内存的选择 · 野火IM开发手册</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="野火IM">
        
        
    
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-navigator/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    


    

        
    
    
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="benchmark.html" />
    
    
    <link rel="prev" href="db_config.html" />
    

    
    <link rel="stylesheet" href="../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    
        <link rel="shortcut icon" href='../favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../favicon.ico' type="image/x-icon">
    
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"wildfirechat/server","types":["star"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.wildfirechat.cn" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                        <b>1.1.</b>
                    
                    产品介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../quick_start/">
            
                <a href="../quick_start/">
            
                    
                        <b>1.2.</b>
                    
                    快速开始
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../quick_start/server.html">
            
                <a href="../quick_start/server.html">
            
                    
                        <b>1.2.1.</b>
                    
                    服务器部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../quick_start/android.html">
            
                <a href="../quick_start/android.html">
            
                    
                        <b>1.2.2.</b>
                    
                    安卓编译
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../quick_start/iOS.html">
            
                <a href="../quick_start/iOS.html">
            
                    
                        <b>1.2.3.</b>
                    
                    iOS编译
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../architecture/">
            
                <a href="../architecture/">
            
                    
                        <b>1.3.</b>
                    
                    系统架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../base_knowledge/">
            
                <a href="../base_knowledge/">
            
                    
                        <b>1.4.</b>
                    
                    基础知识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../base_knowledge/sdk_demo.html">
            
                <a href="../base_knowledge/sdk_demo.html">
            
                    
                        <b>1.4.1.</b>
                    
                    SDK与Demo的关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../base_knowledge/user.html">
            
                <a href="../base_knowledge/user.html">
            
                    
                        <b>1.4.2.</b>
                    
                    用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../base_knowledge/sdk_abilities.html">
            
                <a href="../base_knowledge/sdk_abilities.html">
            
                    
                        <b>1.4.3.</b>
                    
                    SDK的功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../base_knowledge/connect.html">
            
                <a href="../base_knowledge/connect.html">
            
                    
                        <b>1.4.4.</b>
                    
                    连接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../base_knowledge/conversation.html">
            
                <a href="../base_knowledge/conversation.html">
            
                    
                        <b>1.4.5.</b>
                    
                    会话
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../base_knowledge/message.html">
            
                <a href="../base_knowledge/message.html">
            
                    
                        <b>1.4.6.</b>
                    
                    消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../base_knowledge/message_content.html">
            
                <a href="../base_knowledge/message_content.html">
            
                    
                        <b>1.4.7.</b>
                    
                    消息内容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="../base_knowledge/message_payload.html">
            
                <a href="../base_knowledge/message_payload.html">
            
                    
                        <b>1.4.8.</b>
                    
                    消息负载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="../base_knowledge/storage_and_sync.html">
            
                <a href="../base_knowledge/storage_and_sync.html">
            
                    
                        <b>1.4.9.</b>
                    
                    存储与同步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="../base_knowledge/offline_message.html">
            
                <a href="../base_knowledge/offline_message.html">
            
                    
                        <b>1.4.10.</b>
                    
                    离线消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="../base_knowledge/group.html">
            
                <a href="../base_knowledge/group.html">
            
                    
                        <b>1.4.11.</b>
                    
                    群组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.12" data-path="../base_knowledge/chatroom.html">
            
                <a href="../base_knowledge/chatroom.html">
            
                    
                        <b>1.4.12.</b>
                    
                    聊天室
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.5.</b>
                    
                    服务器说明
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="server_port.html">
            
                <a href="server_port.html">
            
                    
                        <b>1.5.1.</b>
                    
                    服务器端口说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="db_config.html">
            
                <a href="db_config.html">
            
                    
                        <b>1.5.2.</b>
                    
                    数据库配置
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.3" data-path="server_memory.html">
            
                <a href="server_memory.html">
            
                    
                        <b>1.5.3.</b>
                    
                    机器内存的选择
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="benchmark.html">
            
                <a href="benchmark.html">
            
                    
                        <b>1.5.4.</b>
                    
                    性能测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="server_config.html">
            
                <a href="server_config.html">
            
                    
                        <b>1.5.5.</b>
                    
                    服务器配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="admin_api/">
            
                <a href="admin_api/">
            
                    
                        <b>1.5.6.</b>
                    
                    Admin API接口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.6.1" data-path="admin_api/user_api.html">
            
                <a href="admin_api/user_api.html">
            
                    
                        <b>1.5.6.1.</b>
                    
                    用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.2" data-path="admin_api/user_relation.html">
            
                <a href="admin_api/user_relation.html">
            
                    
                        <b>1.5.6.2.</b>
                    
                    用户关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.3" data-path="admin_api/robot_api.html">
            
                <a href="admin_api/robot_api.html">
            
                    
                        <b>1.5.6.3.</b>
                    
                    机器人
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.4" data-path="admin_api/message_api.html">
            
                <a href="admin_api/message_api.html">
            
                    
                        <b>1.5.6.4.</b>
                    
                    消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.5" data-path="admin_api/group_api.html">
            
                <a href="admin_api/group_api.html">
            
                    
                        <b>1.5.6.5.</b>
                    
                    群组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.6" data-path="admin_api/chatroom_api.html">
            
                <a href="admin_api/chatroom_api.html">
            
                    
                        <b>1.5.6.6.</b>
                    
                    聊天室
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.7" data-path="admin_api/sensitive_word_api.html">
            
                <a href="admin_api/sensitive_word_api.html">
            
                    
                        <b>1.5.6.7.</b>
                    
                    敏感词
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6.8" data-path="admin_api/error_code.html">
            
                <a href="admin_api/error_code.html">
            
                    
                        <b>1.5.6.8.</b>
                    
                    code状态码
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="robot_api/">
            
                <a href="robot_api/">
            
                    
                        <b>1.5.7.</b>
                    
                    Robot API接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="event_callback.html">
            
                <a href="event_callback.html">
            
                    
                        <b>1.5.8.</b>
                    
                    事件回调
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="push_config.html">
            
                <a href="push_config.html">
            
                    
                        <b>1.5.9.</b>
                    
                    推送说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="media_server.html">
            
                <a href="media_server.html">
            
                    
                        <b>1.5.10.</b>
                    
                    媒体服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="server_clean.html">
            
                <a href="server_clean.html">
            
                    
                        <b>1.5.11.</b>
                    
                    服务的维护
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="mysql_tune.html">
            
                <a href="mysql_tune.html">
            
                    
                        <b>1.5.12.</b>
                    
                    MySQL调优
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../android/">
            
                <a href="../android/">
            
                    
                        <b>1.6.</b>
                    
                    Android开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../android/compile.html">
            
                <a href="../android/compile.html">
            
                    
                        <b>1.6.1.</b>
                    
                    代码编译与工程说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../android/ChatClient.html">
            
                <a href="../android/ChatClient.html">
            
                    
                        <b>1.6.2.</b>
                    
                    ChatClient简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../android/ChatUIKit.html">
            
                <a href="../android/ChatUIKit.html">
            
                    
                        <b>1.6.3.</b>
                    
                    ChatUIKit简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../android/wildfirechat.html">
            
                <a href="../android/wildfirechat.html">
            
                    
                        <b>1.6.4.</b>
                    
                    WildfireChat简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../android/push.html">
            
                <a href="../android/push.html">
            
                    
                        <b>1.6.5.</b>
                    
                    推送集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../ios/">
            
                <a href="../ios/">
            
                    
                        <b>1.7.</b>
                    
                    iOS开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../ios/compile.html">
            
                <a href="../ios/compile.html">
            
                    
                        <b>1.7.1.</b>
                    
                    代码编译与工程说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../ios/chatclient.html">
            
                <a href="../ios/chatclient.html">
            
                    
                        <b>1.7.2.</b>
                    
                    ChatClient简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../ios/chatuikit.html">
            
                <a href="../ios/chatuikit.html">
            
                    
                        <b>1.7.3.</b>
                    
                    ChatUIKit简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../ios/wildfirechat.html">
            
                <a href="../ios/wildfirechat.html">
            
                    
                        <b>1.7.4.</b>
                    
                    WildfireChat简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../ios/push.html">
            
                <a href="../ios/push.html">
            
                    
                        <b>1.7.5.</b>
                    
                    推送集成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../faq/">
            
                <a href="../faq/">
            
                    
                        <b>1.8.</b>
                    
                    常见问题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../faq/general.html">
            
                <a href="../faq/general.html">
            
                    
                        <b>1.8.1.</b>
                    
                    通用问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../faq/server.html">
            
                <a href="../faq/server.html">
            
                    
                        <b>1.8.2.</b>
                    
                    服务器问题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.2.1" data-path="../faq/server/q1.html">
            
                <a href="../faq/server/q1.html">
            
                    
                        <b>1.8.2.1.</b>
                    
                    如何导入到IDE中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2.2" data-path="../faq/server/q2.html">
            
                <a href="../faq/server/q2.html">
            
                    
                        <b>1.8.2.2.</b>
                    
                    如何解决等登陆但一直连接中的问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../faq/android.html">
            
                <a href="../faq/android.html">
            
                    
                        <b>1.8.3.</b>
                    
                    安卓问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../faq/ios.html">
            
                <a href="../faq/ios.html">
            
                    
                        <b>1.8.4.</b>
                    
                    iOS问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >机器内存的选择</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;">&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;</a></li><ul><li><a href="#&#x6D88;&#x606F;&#x6570;&#x636E;">&#x6D88;&#x606F;&#x6570;&#x636E;</a></li><li><a href="#&#x5176;&#x5B83;&#x6570;&#x636E;">&#x5176;&#x5B83;&#x6570;&#x636E;</a></li><li><a href="#&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</a></li></ul></ul></div><a href="#&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;"><a name="&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;" class="anchor-navigation-ex-anchor" href="#&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;</h1>
<p>&#x91CE;&#x706B;IM&#x4F7F;&#x7528;&#x4E86;<a href="https://hazelcast.com" target="_blank">hazelcast</a>&#x4F5C;&#x4E3A;&#x5185;&#x5B58;&#x7F13;&#x5B58;&#x3002;&#x5728;&#x5185;&#x5B58;&#x8D8A;&#x6765;&#x8D8A;&#x4FBF;&#x5B9C;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x5408;&#x7406;&#x5730;&#x4F7F;&#x7528;&#x7F13;&#x5B58;&#xFF0C;&#x4F1A;&#x5E26;&#x6765;&#x6027;&#x80FD;&#x7684;&#x5927;&#x5E45;&#x63D0;&#x5347;&#x3002;&#x91CE;&#x706B;IM&#x9488;&#x5BF9;&#x4E0D;&#x540C;&#x7684;&#x6570;&#x636E;&#x4F7F;&#x7528;&#x4E0D;&#x540C;&#x7684;&#x7F13;&#x5B58;&#x7B56;&#x7565;&#x3002;</p>
<h2 id="&#x6D88;&#x606F;&#x6570;&#x636E;">1. &#x6D88;&#x606F;&#x6570;&#x636E;</h2>
<h4 id="&#x6D88;&#x606F;&#x5BF9;&#x5185;&#x5B58;&#x7684;&#x5360;&#x7528;">1.0.1. &#x6D88;&#x606F;&#x5BF9;&#x5185;&#x5B58;&#x7684;&#x5360;&#x7528;</h4>
<p>&#x91CE;&#x706B;IM&#x91C7;&#x7528;&#x4E86;&#x5148;&#x8FDB;&#x7684;&#x8BBE;&#x8BA1;&#xFF0C;&#x5BF9;&#x4E8E;&#x6D88;&#x606F;&#x53EA;&#x4FDD;&#x5B58;&#x4E00;&#x6761;&#x539F;&#x59CB;&#x6570;&#x636E;&#x3002;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;1&#x5BF9;1&#x804A;&#x5929;&#x548C;&#x7FA4;&#x804A;&#x6BCF;&#x53D1;&#x4E00;&#x6761;&#x6D88;&#x606F;&#xFF0C;&#x91CE;&#x706B;IM&#x53EA;&#x4FDD;&#x5B58;&#x4E00;&#x6761;&#x6D88;&#x606F;&#x3002;&#x53E6;&#x5916;&#x91CE;&#x706B;IM&#x7684;&#x6D88;&#x606F;&#x5C3A;&#x5BF8;&#x6BD4;&#x8F83;&#x5C0F;&#xFF0C;&#x5BF9;&#x4E8E;&#x56FE;&#x7247;&#x89C6;&#x9891;&#x8BED;&#x97F3;&#x90FD;&#x662F;&#x4F5C;&#x4E3A;&#x5A92;&#x4F53;&#x6587;&#x4EF6;&#x4E0A;&#x4F20;&#x5230;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x6D88;&#x606F;&#x4F53;&#x5185;&#x53EA;&#x4FDD;&#x5B58;&#x4E00;&#x4E2A;url&#xFF0C;&#x6D88;&#x606F;&#x4F7F;&#x7528;pb&#x683C;&#x5F0F;&#x5B58;&#x50A8;&#xFF0C;&#x5E73;&#x5747;&#x4E0B;&#x6765;&#x4E0D;&#x4F1A;&#x5927;&#x4E8E;1K&#x5B57;&#x8282;&#x3002;</p>
<h4 id="&#x7F13;&#x5B58;&#x7684;&#x914D;&#x7F6E;">1.0.2. &#x7F13;&#x5B58;&#x7684;&#x914D;&#x7F6E;</h4>
<p>&#x6D88;&#x606F;&#x6570;&#x636E;&#x4F1A;&#x968F;&#x7740;&#x65F6;&#x95F4;&#x7EBF;&#x6027;&#x79EF;&#x7D2F;&#xFF0C;&#x800C;&#x4E14;&#x65E7;&#x7684;&#x6D88;&#x606F;&#x53EF;&#x80FD;&#x518D;&#x4E5F;&#x7528;&#x4E0D;&#x5230;&#xFF0C;&#x56E0;&#x6B64;&#x5BF9;&#x4E8E;&#x6D88;&#x606F;&#xFF0C;&#x91CE;&#x706B;IM&#x7684;&#x5EFA;&#x8BAE;&#x6BCF;&#x4E2A;&#x7528;&#x6237;&#x7F13;&#x5B58;&#x6700;&#x65B0;100&#x6761;7&#x5929;&#x4EE5;&#x5185;&#x6D88;&#x606F;&#x3002;&#x9884;&#x4F30;&#x4E00;&#x4E0B;&#xFF0C;&#x5047;&#x5982;&#x6BCF;&#x6761;&#x6D88;&#x606F;1K&#xFF0C;10W&#x6D3B;&#x8DC3;&#x7528;&#x6237;&#xFF0C;10W <em> 100 </em> 1K = 10G&#x3002;&#x5F53;&#x7528;&#x6237;&#x63A5;&#x6536;&#x6D88;&#x606F;&#x7F13;&#x5B58;&#x6CA1;&#x6709;&#x547D;&#x4E2D;&#x65F6;&#xFF0C;&#x4F1A;&#x4ECE;&#x6570;&#x636E;&#x5E93;&#x52A0;&#x8F7D;&#x8BE5;&#x6D88;&#x606F;&#xFF0C;&#x4E0D;&#x4F1A;&#x4E22;&#x5931;&#x6D88;&#x606F;&#x3002;&#x4FEE;&#x6539;&#x914D;&#x7F6E;<code>config/hazelcast.xml</code>, <code>max-size</code>&#x4FEE;&#x6539;&#x4E3A;&#x60A8;&#x7684;&#x7528;&#x6237;&#x6570;*100&#x3002;&#x5982;&#x679C;&#x60A8;&#x4F7F;&#x7528;&#x5546;&#x4E1A;&#x7248;&#x548C;mongodb&#xFF0C;&#x7F13;&#x5B58;&#x6761;&#x6570;&#x53EF;&#x4EE5;&#x51CF;&#x534A;&#x3002;</p>
<pre class="language-"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>map</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>messages_map<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token comment">&lt;!-- 7 days --&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>time-to-live-seconds</span><span class="token punctuation">&gt;</span></span>604800<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>time-to-live-seconds</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>eviction-policy</span><span class="token punctuation">&gt;</span></span>LRU<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>eviction-policy</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>max-size</span> <span class="token attr-name">policy</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>PER_NODE<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>10000000<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>max-size</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>eviction-percentage</span><span class="token punctuation">&gt;</span></span>10<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>eviction-percentage</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>map-store</span> <span class="token attr-name">enabled</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>class-name</span><span class="token punctuation">&gt;</span></span>io.wildfirechat.persistence.MessageLoader<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>class-name</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>write-delay-seconds</span><span class="token punctuation">&gt;</span></span>0<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>write-delay-seconds</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>map-store</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>map</span><span class="token punctuation">&gt;</span></span>
</code></pre><blockquote>
<p>&#x6CE8;&#xFF1A;&#x6D3B;&#x8DC3;&#x7528;&#x6237;&#x6570;&#x6307;7&#x5929;&#x4EE5;&#x5185;&#x767B;&#x9646;&#x7684;&#x7528;&#x6237;&#x6570;&#x3002;</p>
</blockquote>
<h2 id="&#x5176;&#x5B83;&#x6570;&#x636E;">2. &#x5176;&#x5B83;&#x6570;&#x636E;</h2>
<p>&#x5176;&#x5B83;&#x6570;&#x636E;&#x6BD4;&#x5982;&#x7528;&#x6237;&#xFF0C;&#x597D;&#x53CB;&#xFF0C;&#x7FA4;&#x7EC4;&#xFF0C;&#x8BBE;&#x7F6E;&#x3002;&#x57FA;&#x672C;&#x4E0E;&#x7528;&#x6237;&#x6570;&#x6210;&#x6BD4;&#x4F8B;&#xFF0C;&#x6BCF;&#x4EBA;&#x4E0D;&#x4F1A;&#x8D85;&#x8FC7;30K&#x6570;&#x636E;&#xFF0C;&#x4E3A;&#x4E86;&#x63D0;&#x9AD8;&#x8BBF;&#x95EE;&#x901F;&#x5EA6;&#xFF0C;&#x56E0;&#x6B64;&#x5168;&#x90E8;&#x653E;&#x5230;&#x5185;&#x5B58;&#x7F13;&#x5B58;&#x4E2D;&#x3002;&#x9884;&#x8BA1;&#x6709;10W&#x6D3B;&#x8DC3;&#x7528;&#x6237;&#xFF0C; 10W * 30K = 3G&#x3002;</p>
<h2 id="&#x603B;&#x7ED3;">3. &#x603B;&#x7ED3;</h2>
<p>&#x5982;&#x679C;&#x60A8;&#x7684;&#x7528;&#x6237;&#x9700;&#x6C42;&#x8F83;&#x9AD8;&#x4E14;&#x7528;&#x6237;&#x6BD4;&#x8F83;&#x6D3B;&#x8DC3;&#xFF0C;&#x5EFA;&#x8BAE;&#x60A8;&#x6BCF;10W&#x6D3B;&#x8DC3;&#x7528;&#x6237;&#x914D;&#x7F6E;16G&#x5185;&#x5B58;&#x3002;&#x4E5F;&#x53EF;&#x4EE5;&#x9002;&#x5F53;&#x964D;&#x4F4E;&#x7F13;&#x5B58;&#x6570;&#x51CF;&#x5C11;&#x5185;&#x5B58;&#x6D88;&#x8017;&#x3002;&#x5546;&#x4E1A;&#x7248;&#x5EFA;&#x8BAE;&#x6BCF;10W&#x7528;&#x6237;12G&#x5185;&#x5B58;&#x3002;</p>
<footer class="page-footer"><span class="copyright">2018 &#xA9; wildfirechat.cn &#x4EAC;ICP&#x5907;18060403&#x53F7;-1 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-03-19 21:40:43
</span></footer><div id="anchors-navbar"><i class="fa fa-anchor"></i><ul><p><a href="#&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;">&#x673A;&#x5668;&#x5185;&#x5B58;&#x7684;&#x9009;&#x62E9;</a></p><li><a href="#&#x6D88;&#x606F;&#x6570;&#x636E;">1. &#x6D88;&#x606F;&#x6570;&#x636E;</a></li><ul><li><a href="#">none</a></li><ul><li><a href="#&#x6D88;&#x606F;&#x5BF9;&#x5185;&#x5B58;&#x7684;&#x5360;&#x7528;">1.0.1. &#x6D88;&#x606F;&#x5BF9;&#x5185;&#x5B58;&#x7684;&#x5360;&#x7528;</a></li><li><a href="#&#x7F13;&#x5B58;&#x7684;&#x914D;&#x7F6E;">1.0.2. &#x7F13;&#x5B58;&#x7684;&#x914D;&#x7F6E;</a></li></ul></ul><li><a href="#&#x5176;&#x5B83;&#x6570;&#x636E;">2. &#x5176;&#x5B83;&#x6570;&#x636E;</a></li><li><a href="#&#x603B;&#x7ED3;">3. &#x603B;&#x7ED3;</a></li></ul></div><a href="#&#x6D88;&#x606F;&#x6570;&#x636E;" id="goTop"><i class="fa fa-arrow-up"></i></a>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="db_config.html" class="navigation navigation-prev " aria-label="Previous page: 数据库配置">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="benchmark.html" class="navigation navigation-next " aria-label="Next page: 性能测试">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"机器内存的选择","level":"1.5.3","depth":2,"next":{"title":"性能测试","level":"1.5.4","depth":2,"path":"server/benchmark.md","ref":"server/benchmark.md","articles":[]},"previous":{"title":"数据库配置","level":"1.5.2","depth":2,"path":"server/db_config.md","ref":"server/db_config.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","-highlight","-livereload","search-plus@^0.0.11","simple-page-toc@^0.1.1","github@^2.0.0","github-buttons@2.1.0","prism@^2.1.0","prism-themes@^0.0.2","anchors@^0.7.1","emphasize@^1.1.0","splitter@^0.0.8","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","sectionx@^3.1.0","local-video@^1.0.1","sitemap-general@^0.1.1","anchor-navigation-ex@0.1.8","favicon@^0.0.2","todo@^0.1.3","3-ba@^0.9.0","terminal@^0.3.2","alerts@^0.2.0","include-csv@^0.1.0","puml@^1.0.1","musicxml@^1.0.2","-sharing","sharing-plus@^0.0.2","graph@^0.1.0","chart@^0.2.0","include-codeblock@^3.0.2","ace@^0.3.2","mermaid-gb3@2.1.0","katex@^1.1.3","navigator"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"2018 © wildfirechat.cn 京ICP备18060403号-1","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"include-csv":{},"disqus":{"shortName":"gitbookuse"},"emphasize":{},"ace":{},"github":{"url":"https://github.com/wildfirechat/docs"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"todo":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"graph":{},"sitemap-general":{"prefix":"http://wildfirechat.cn"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"musicxml":{},"sectionx":{"tag":"b"},"mermaid-gb3":{},"anchor-navigation-ex":{"isRewritePageTitle":false,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"favicon":{"shortcut":"favicon.ico","bookmark":"favicon.ico"},"prism-themes":{},"navigator":{},"alerts":{},"github-buttons":{"repo":"wildfirechat/server","types":["star"],"size":"small"},"3-ba":{"configuration":"auto","token":"ff100361cdce95dd4c8fb96b4009f7bc"},"expandable-chapters-small":{},"local-video":{},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":true,"all":["facebook","google","twitter","weibo","instapaper","linkedin","pocket","stumbleupon","qq","qzone"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":true},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"chart":{"type":"c3"},"search-plus":{}},"theme":"default","author":"野火IM","pdf":{"pageNumbers":true,"fontSize":9,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":45,"left":45,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"野火IM开发手册","links":{"sidebar":{"Home":"http://www.wildfirechat.cn"}},"gitbook":"*","description":"野火IM开发手册"},"file":{"path":"server/server_memory.md","mtime":"2019-03-19T13:40:43.019Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-24T12:42:00.565Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-3-ba/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-musicxml/osmd.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-musicxml/musicxml.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-musicxml/promise.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    <script src="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

